.\" Copyright (c) 2020  Peter Pentchev <roam@ringlet.net>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
.\"
.\"  1. Redistributions of source code must retain the above copyright notice,
.\"     this list of conditions and the following disclaimer.
.\"
.\"  2. Redistributions in binary form must reproduce the above copyright notice,
.\"     this list of conditions and the following disclaimer in the documentation
.\"     and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 31, 2020
.Dt ZCKDL 1
.Os
.Sh NAME
.Nm zckdl
.Nd download a zchunk file
.Sh SYNOPSIS
.Nm
.Op Fl -fail-no-ranges
.Op Fl q | Fl -quiet
.Op Fl s Ar file | Fl -source Ns = Ns Ar file
.Op Fl v | Fl -verbose
.Ar url
.Nm
.Fl ? | Fl -help | Fl -usage | Fl -version
.Sh DESCRIPTION
The
.Nm
utility attempts to download a zchunk file in an optimized way,
taking into consideration the chunked structure.
.Pp
The
.Nm
utility accepts the following optional arguments:
.Pp
.Bl -tag -width indent
.It Fl -fail-no-ranges
If the server does not support ranges, fail instead of downloading
the whole file.
.It Fl q | Fl -quiet
Quiet operation; only display warning and error messages.
If specified twice, only display error messages.
.It Fl s | Fl -source
Specify the file to use as a source with the premise that most of
the chunks in the downloaded file will be the same.
.It Fl v , Fl -verbose
Verbose operation; display some diagnostic output.
.It Fl ? , Fl -help
Display program usage information and exit.
.It Fl -usage
Display brief program usage information and exit.
.It Fl -version
Display program version information and exit.
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Download a zchunk file that is hopefully not much different from
the previous version:
.Pp
.Dl zckdl -s doc1.txt.zck https://example.com/doc2.txt.zck
.Pp
.Sh SEE ALSO
.Xr unzck 1 ,
.Xr zck 1 ,
.Xr zck_delta_size 1 ,
.Xr zck_gen_zdict 1 ,
.Xr zck_read_header 1
.Sh AUTHOR
The
.Nm
utility was written by
.An Jonathan Dieter Aq jdieter@gmail.com .
This manual page stub was written by
.An Peter Pentchev Aq roam@ringlet.net .
